home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.BorderLayout;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Window;
-
- public class ArcTest extends Applet {
- ArcControls controls;
-
- public void init() {
- ((Container)this).setLayout(new BorderLayout());
- ArcCanvas c = new ArcCanvas();
- ((Container)this).add("Center", c);
- ((Container)this).add("South", this.controls = new ArcControls(c));
- }
-
- public void start() {
- this.controls.enable();
- }
-
- public void stop() {
- this.controls.disable();
- }
-
- public boolean handleEvent(Event e) {
- if (e.id == 201) {
- System.exit(0);
- }
-
- return false;
- }
-
- public static void main(String[] args) {
- Frame f = new Frame("ArcTest");
- ArcTest arcTest = new ArcTest();
- arcTest.init();
- arcTest.start();
- ((Container)f).add("Center", arcTest);
- ((Component)f).resize(300, 300);
- ((Window)f).show();
- }
- }
-